// -------------------------------------------------
// BlinKit - BlinKit Library
// -------------------------------------------------
//   File Name: mac_app.mm
// Description: MacApp Class
//      Author: Ziming Li
//     Created: 2022-09-22
// -------------------------------------------------
// Copyright (C) 2022 MingYang Software Technology.
// -------------------------------------------------

#include "./mac_app.h"

#include "third_party/zed/include/zed/apple/cf_wrappers.hpp"
#include "third_party/zed/include/zed/apple/ns_wrappers.hpp"

namespace BlinKit {

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void AppImpl::Log(const char *s)
{
    zed::cf_string_ref sr(s, true);
    CFShow(sr.get());
}

#ifdef BLINKIT_UI_ENABLED
void AppImpl::DefaultOpenURL(const char *URL)
{
    zed::ns_url u(URL);
    [NSWorkspace.sharedWorkspace openURL: u.get()];
}
#endif

} // namespace BlinKit
